{% extends "common/layout.html" %}
{% block content %}

    <div class="row">
        <div class="col-sm-5 " role="document">
            <div class="panel panel-primary ">
                {#标题#}
                <div class="panel-heading">任务卡</div>
                <div class="panel-body">
                    <div class="row title">
                        <div class="col-sm-3">
                            <a href="{{ buildUrl('/work/index') }}" class="btn btn-primary" role="button">返回</a>
                        </div>
                        <div class="col-sm-4">
                            <h4 style="color: #2e6da4"><strong>系统开发类任务卡</strong></h4>
                        </div>
                        {% if taskinfo %}
                            <div class="col-sm-5 ">
                                <input value="{{ taskinfo.id }}" class="hidden" name="updataid"/>
                                <button type="submit" class="btn btn-success do-done">完成</button>
                                {% if flag == 1 %}
                                    <button type="submit" class="btn btn-warning do-getback">取回
                                    </button>
                                {% else %}
                                    <button type="submit" class="btn btn-info " data-toggle="modal" data-target="#user">
                                        改派
                                    </button>
                                {% endif %}
                                <button type="submit" class="btn btn-danger  do-delete">取消</button>
                            </div>
                        {% else %}
                            <div class="col-sm-4 ">
                                <select class="form-control" name="task">
                                    {% if flag == 2 %}
                                        <option>完成</option>
                                    {% endif %}
                                    <option>计划</option>
                                    <option>完成</option>
                                </select>

                            </div>
                        {% endif %}
                    </div>
                    {#表单#}
                    <div class="form-horizontal form" style="margin-top: 10px">
                        {#时间选择器#}
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary ">事件时间</label>
                            <div class='col-sm-6'>
                                <div class='input-group date' id='datetimepicker1'>
                                    <input type='text' class="form-control" name="datatime"
                                           value="{{ taskinfo.listdata }}"/>
                                    <span class="input-group-addon"><span
                                            class="glyphicon glyphicon-calendar"></span></span>
                                </div>
                            </div>
                        </div>
                        <script type="text/javascript">
                            var mydata = new Date()
                            $(function () {
                                $('#datetimepicker1').datetimepicker({
                                    format: 'YYYY-MM-DD',
                                    locale: moment.locale('zh-cn'),
                                    defaultDate: mydata.toLocaleDateString()
                                });
                                $('#datetimepicker2').datetimepicker({
                                    format: 'YYYY-MM-DD hh:mm',
                                    locale: moment.locale('zh-cn')
                                });
                            });
                        </script>
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary ">任务权重</label>
                            <div class="col-sm-6">
                                {% if taskinfo %}
                                    <input class="form-control " name="weight" value="{{ taskinfo.weight }}"/>
                                {% else %}
                                    <input class="form-control " name="weight" value="50"/>
                                {% endif %}
                            </div>
                        </div>

                        {#分类#}
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary ">项目名称</label>
                            <div class="col-sm-6">
                                <select class="form-control " name="classone">
                                    {% if taskinfo %}
                                        <option>{{ taskinfo.classone }}</option>
                                    {% endif %}
                                    <option>工作任务平台</option>
                                    <option>移动办公平台</option>
                                    <option>数据展示平台</option>
                                </select>
                            </div>
                        </div>
                        {#分类#}
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary">模块</label>
                            <div class="col-sm-6">
                                <input class="form-control" name="classtwo" id="classtwo"/>
                                <script>
                                    document.getElementById("classtwo").value = "{{ taskinfo.classtwo }}"
                                </script>
                            </div>
                        </div>

                        {#分类#}
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary">需求</label>
                            <div class="col-sm-6">
                                <input class="form-control" name="classthree" id="classthree"/>
                                <script>
                                    document.getElementById("classthree").value = "{{ taskinfo.classthree }}"
                                </script>
                            </div>
                        </div>
                        {#备注#}
                        <div class="form-group">
                            <label class="col-sm-2 control-label text-primary">解决方案</label>
                            <div class="col-sm-10">
                            <textarea class="form-control" rows="5" id="remark" name="remark"
                                      placeholder="请输入解决方案"></textarea>
                                <script>
                                    document.getElementById("remark").value = "{{ taskinfo.listremark }}"
                                </script>
                            </div>
                        </div>
                        {#提交按钮#}
                        <div class="form-group">
                            <div class="col-sm-12">
                                {% if taskinfo %}
                                    <button type="submit" class="btn btn-primary btn-block do-updata">更新任务卡</button>
                                {% else %}
                                    <button type="submit" class="btn btn-success btn-block do-post">创建任务卡</button>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-sm-7" role="document">
            <div class="panel panel-primary ">
                <div class="panel-heading">制度卡</div>
                <div class="panel-body pre-scrollable" style="min-height: 700px">
                    <div>
                        {{ content |safe }}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 模态框（Modal） -->
    <div class="modal fade " id="user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">选择人员</h4>
                </div>


                <div class="input-group col-sm-6 col-sm-offset-1 lookupuser " style="margin-top: 15px">
                    <input type="text" class="form-control col-sm-6" name="lookupuser" placeholder="请输入姓名...">
                    <span class="input-group-btn">
                               <button class="btn btn-default do-lookupuser" type="button">查找</button>
                            </span>
                </div><!-- /input-group -->


                <div class="panel panel-default" style="margin-top: 15px">
                    <div class="form-horizontal user_wrap" style="margin-top: 15px">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control"
                                       readonly="readonly" id="name">
                                <input class="hidden" id="uid" name="uid">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">公司</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" readonly="readonly" id="company">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">部门</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" readonly="readonly" id="dep"
                                >
                            </div>
                        </div>
                    </div>
                </div>


                <div class="modal-footer">
                    <button type="button" class="btn btn-primary do-changeuser">确定指派</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>



{% endblock %}

{% block js %}
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="static/js/moment-with-locales.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
    <script src="{{ buildStaticUrl('/js/work/itprogram.js') }}"></script>
    <script src="{{ buildStaticUrl('/js/tempcommon.js') }}"></script>
{% endblock %}


